<template>
  <h2>当前鼠标点击的坐标为x：{{ point.x }} y：{{ point.y }}</h2>
</template>

<script>


import usePoint from '../hooks/usePoint'
//hook作用：把组合api进行封装 类似于vue2中的mixin
export default {
  name: "Demo",
  setup() {
    //调用hook里面的方法 获取鼠标位置
    let point = usePoint()
    return {
      point
    }
  }
}
</script>

<style scoped>

</style>
